﻿<Window x:Class="TciNewsReader_2014_04.Controls.Config"
        xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
        xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
        xmlns:controls="clr-namespace:TciNewsReader_2014_04.Controls"
        xmlns:infrastructure="clr-namespace:TciNewsReader_2014_04.Infrastructure"
        xmlns:vmHelpers="clr-namespace:TciNewsReader_2014_04.VmHelpers"
        xmlns:customControls="clr-namespace:CustomControls;assembly=CustomControls"
        Title="{x:Static infrastructure:Constants.ApplicationTitle}" 
        WindowStartupLocation="CenterScreen" Icon="/TciNewsReader-2014-04;component/Resources/Images/Identity/tyburn-geoOrb.png" 
        ShowInTaskbar="False" Topmost="True" SnapsToDevicePixels="True" ResizeMode="NoResize" WindowStyle="ToolWindow"
        >
    <Window.Resources>
        <vmHelpers:ConfigInfo x:Key="ConfigInfo"/>
    </Window.Resources>
    <Grid Background="{StaticResource CustomGradientGreenEmber}">
        <DockPanel>
            <DockPanel DockPanel.Dock="Bottom" HorizontalAlignment="Stretch">
                <DockPanel.Resources>
                    <Style TargetType="Button">
                        <Setter Property="Width" Value="100"/>
                    </Style>
                </DockPanel.Resources>
                <StackPanel HorizontalAlignment="Right" Orientation="Horizontal">
                    <Button Content="Ok" HorizontalAlignment="Right" CommandParameter="true" Command="{Binding ConfigDoneCommand}"/>
                    <customControls:InterItemGap/>
                </StackPanel>
            </DockPanel>
            <DockPanel DockPanel.Dock="Bottom" Background="Navy">
                <Grid DockPanel.Dock="Top" HorizontalAlignment="Center" Margin="10">
                    <Grid.Resources>
                        <Style TargetType="TextBlock">
                            <Setter Property="TextWrapping" Value="Wrap"/>
                            <Setter Property="Foreground" Value="Wheat"/>
                        </Style>
                    </Grid.Resources>
                    <Grid.ColumnDefinitions>
                        <ColumnDefinition MaxWidth="300"/>
                    </Grid.ColumnDefinitions>
                    <TextBlock Grid.Column="0" Grid.Row="0" Text="This panel shows the underlying configuration."/>
                </Grid>
            </DockPanel>
            <customControls:TextBlockPanelHeader DockPanel.Dock="Top" Text="Configuration" />
            <Rectangle DockPanel.Dock="Top" Height="30"/>
            <Grid DockPanel.Dock="Top" HorizontalAlignment="Center" Background="{StaticResource CustomGradientGreenEmber}" DataContext="{StaticResource ConfigInfo}" >
                <Grid.Resources>
                    <Style TargetType="TextBlock">
                        <Setter Property="Foreground" Value="Wheat"/>
                        <Setter Property="HorizontalAlignment" Value="Left"/>
                        <Setter Property="VerticalAlignment" Value="Center"/>
                        <Setter Property="FontWeight" Value="Bold"/>
                    </Style>
                    <Style TargetType="customControls:OpenEditButton">
                        <Setter Property="Command" Value="{Binding ProcessCommand}"/>
                        <Setter Property="ProgramName" Value="{Binding Editor}"/>
                        <Setter Property="ToolTip.Foreground" Value="Wheat"/>
                        <Setter Property="ToolTip" Value="Open this file in Notepad"/>
                    </Style>
                </Grid.Resources>
                <Grid.RowDefinitions>
                    <RowDefinition/>
                    <RowDefinition/>
                    <RowDefinition/>
                    <RowDefinition/>
                    <RowDefinition/>
                    <RowDefinition/>
                    <RowDefinition/>
                    <RowDefinition/>
                    <RowDefinition/>
                </Grid.RowDefinitions>
                <Grid.ColumnDefinitions>
                    <ColumnDefinition Width="145"/>
                    <ColumnDefinition Width="250"/>
                    <ColumnDefinition Width="120"/>
                </Grid.ColumnDefinitions>
                <TextBlock Grid.Column="0" Grid.Row="0" Text="Data file location"/>
                <TextBlock Grid.Column="1" Grid.Row="0" Text="{Binding UrlFileLocation}"/>
                <customControls:OpenEditButton Grid.Column="2" Grid.Row="0" TargetName="{Binding UrlFileLocation}" />
                <TextBlock Grid.Column="0" Grid.Row="1" Text="Log file location"/>
                <TextBlock Grid.Column="1" Grid.Row="1" Text="{Binding LogFileLocation }"/>
                <customControls:OpenEditButton Grid.Column="2" Grid.Row="1"  TargetName="{Binding LogFileLocation}"/>
                <TextBlock Grid.Column="0" Grid.Row="2" Text="History file location"/>
                <TextBlock Grid.Column="1" Grid.Row="2" Text="{Binding  HistoryLocation }"/>
                <customControls:OpenEditButton Grid.Column="2" Grid.Row="2" TargetName="{Binding HistoryLocation}"/>
                <TextBlock Grid.Column="0" Grid.Row="3" Text="Async tasking"/>
                <TextBlock Grid.Column="1" Grid.Row="3" Text="{Binding AsyncTasking }"/>
                <TextBlock Grid.Column="0" Grid.Row="4" Text="Show exceptions on exit"/>
                <TextBlock Grid.Column="1" Grid.Row="4" Text="{Binding ShowErrorsOnExit }"/>
                <TextBlock Grid.Column="0" Grid.Row="5" Text="Noise alerts"/>
                <TextBlock Grid.Column="1" Grid.Row="5" Text="{Binding NoiseAlerts}"/>
                <TextBlock Grid.Column="0" Grid.Row="6" Text="Default feed inclusion"/>
                <TextBlock Grid.Column="1" Grid.Row="6" Text="{Binding DefaultFeedInclusion}"/>
                <TextBlock Grid.Column="0" Grid.Row="7" Text="Max item history"/>
                <TextBlock Grid.Column="1" Grid.Row="7" Text="{Binding MaxHistoryItems}"/>
            </Grid>
            <Rectangle DockPanel.Dock="Top"/>
        </DockPanel>
    </Grid>
</Window>
